<script setup lang="ts">
  defineOptions({
    name: 'HeaderNetworkCreate',
  })

  const props = defineProps({
    isAdd: {
      type: Boolean,
      default: () => true,
    },
  })

  const emits = defineEmits<{
    (e: 'save'): void
    (e: 'cancel'): void
  }>()
</script>

<template>
  <div class="header-network-create">
    <div class="title">{{ props.isAdd ? '新增网点' : '编辑网点' }}</div>
    <div class="btn-group">
      <HPlainButton @click="emits('save')">保存</HPlainButton>
      <HButton @click="emits('cancel')"> 取消 </HButton>
    </div>
  </div>
</template>

<style scoped lang="scss">
  .header-network-create {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;

    .title {
      font-size: 14px;
      font-weight: bold;
    }

    .btn-group {
      display: flex;
      column-gap: 5px;
    }
  }
</style>
